<template>
	<div class="view">
		<Input v-model="data.condition" 
			style="width: 600px"
			:placeholder="data.placeholder"
			@on-enter="click2Search">
			<Select v-model="data.filter" v-if="data.filters.length > 0"
				slot="prepend" 
				style="width: 100px"
				@on-change="click2Search">
				<Option v-for="(item, index) in data.filters" 
					:value="item.value"
					:key="index">
					{{item.label}}
				</Option>
			</Select>
			
			<Button slot="append" icon="ios-search"
				@click="click2Search"
				:loading="loading">
				搜索
			</Button>
		</Input>
	</div>
</template>

<script>
	export default {
		props: ['data', 'loading'],
		data() {
			return {
			}
		},
		mounted() {},
		methods: {
			click2Search() {
				this.$emit('on-search', this.data);
			}
		}
	}
</script>

<style scoped>

</style>